/*
(1)sorted array
(2)check nullpointer
(3)constant space
(4)
*/
    public class Solution {
           public int removeDuplicates(int[] nums) {
            if (nums.length <= 0 || null == nums) {
                return 0;
            }
            int count = 1;
            for (int i = 1; i < nums.length; i++) {
                if (nums[i - 1] == nums[i]) {
                    continue;
                }
                nums[count++] = nums[i];//不是让求长度吗。。。我也搞不懂。。
            }
            return count;
        }
    }